package com.wenguodong.demofirstt.mapper;

/*
 *@Time：2023/4/15
 *@Author：Jelly
 */

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wenguodong.demofirstt.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where user_name = #{userName} and user_password = #{userPassword}")
    public Integer getUserByNameAndPassword(String userName, String userPassword);

    @Insert("insert into user values (null,#{userName},#{userPassword},#{userSex},#{userAge},#{userEmail})")
    @Options(useGeneratedKeys = true,keyProperty = "userId")
    public Integer addUser(User user);

}
